// app/controller/tag.js
const { Controller } = require('egg');

class TagController extends Controller {
    async getTags() {
        const { ctx, service } = this
        console.log('TagController', service.tag.getTags)
        const result = await service.tag.getTags()
        if(result) {
            let obj = {
                tags: result
            }
            ctx.body = ctx.showSuccess(obj)
        } else {
            ctx.body = {
                code: ctx.errorMap.getTagListFail.code,
                message: ctx.errorMap.getTagListFail.message,
            }
        }
    }
}

module.exports = TagController;